package edu.chl.tda367.mynotes.view;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.*;

/*
 * The applications statusbar. Nothing is yet added in this bar, it's just
 * there.
 */

@SuppressWarnings("serial")
public class StatusBarPanel extends JPanel {
	
	private Color color1 = new Color(240,240,240);
	private Color color2 = new Color(200,200,200);
	

	public StatusBarPanel(){
		setBackground(new Color(90,90,90));
		setPreferredSize(new Dimension(1000, 20));
	}
	
	/**
	 *  Method that draws a gradient pattern.
	 */
	@Override
	public void paintComponent(Graphics g){
		Graphics2D g2d = (Graphics2D)g;
		int w = getWidth( );
		int h = getHeight( );
		 
		// Paint a gradient from top to bottom
		GradientPaint gp = new GradientPaint(
		    0, 0, color1,
		    0, h, color2 );

		g2d.setPaint( gp );
		g2d.fillRect( 0, 0, w, h );
	}
}
